<%-- 
    Document   : newjsp
    Created on : 23.02.2013, 14:01:16
    Author     : Artem
--%>

<%@page import="java.math.BigDecimal"%>
<%@page import="com.bionic.entity.Users"%>
<%@page import="com.bionic.dao.UserDAO"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<jsp xmlns:jsp="http://java.sun.com/JSP/Page" 
     xmlns:c="http://java.sun.com/jsp/jstl/core"/>
<!DOCTYPE html>
<html>
    <head>
        <title>UserForm</title>
    </head>
    <body>
       <%--
        <h3>User</h3>
        <hr/>
--%>
        <%--       
              
        
        

           <% UserDAO userDAO = new UserDAO();
              Users user1 = userDAO.findById(BigDecimal.valueOf(1));
              request.setAttribute("userBean", user1);
           %>
           <br><br>
           <%= (Users)request.getAttribute("userBean") %>
           
           <br><br>
           <table border="1">

         <!--  <c:forEach items=(Users)request.getAttribute("userList") var="user"> -->
               <tr>
                  <td><%= user1.getFirstName() %></td>  
                  <td><%= user1.getLastName() %></td>  
               </tr>    
               <tr>
                  <td><%= user1.getFirstName() %></td>  
                  <td><%= user1.getLastName() %></td>  
               </tr>    
               
           </c:forEach>
            
                  </table>


           <hr/>

     
        --%>
       
        <%--
        
        <jsp:useBean id="userBean" scope = "request" class = "com.bionic.entity.Users" />
        <jsp:getProperty name="userBean" property="id"/> <br>
        <jsp:getProperty name="userBean" property="firstName"/>

        <hr/>
--%>
        <h3>Все пользователи<h3>
        <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="core" %>




        <table>
           <thead>
             <tr>
                  <td>id</td>	
                    <td>firstName</td>
                    <td>lastName</td>
                    <td>phone</td>
                    <td>login</td>
                    <td>password</td>
             </tr>
            </thead>
            <core:forEach items="${userList}" var="mUser">
                <tr>
                    <td>${mUser.id}</td>	
                    <td>${mUser.firstName}</td>
                    <td>${mUser.lastName}</td>
                    <td>${mUser.phone}</td>
                    <td>${mUser.login}</td>
                    <td>${mUser.password}</td>
                </tr>
            </core:forEach>
        </table>

      


        <%@ include file="navbar.jsp" %>   
        <%@ include file="debugInfo.jsp" %>
    </body>
</html>
